package com.lqq.view;

import com.lqq.componment.OrderBox;
import sun.misc.Resource;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.io.File;
import java.io.IOException;


public class Home {
    public static void show() throws IOException {
        JFrame jf=new JFrame();
        jf.setVisible(true);
        jf.setSize(700,500);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.setTitle("首 页");
        jf.setLocationRelativeTo(null);

        JPanel panel=new JPanel(null);

        JTextField text1=new JTextField();
        text1.setBounds(35,45,380,30);


        JButton btn1=new JButton("搜索");
        btn1.setBounds(420,45,68,30);

        JLabel lab1=new JLabel("昵称");
        lab1.setBounds(522,21,48,17);
        JLabel lab2=new JLabel("头像");
        lab2.setBounds(582,21,60,60);



        Box boxOrder1=OrderBox.creatOrderBox(52,127);
        Box boxOrder2=OrderBox.creatOrderBox(358,127);
        Box boxOrder3=OrderBox.creatOrderBox(52,277);
        Box boxOrder4=OrderBox.creatOrderBox(358,277);


        panel.add(lab1);
        panel.add(lab2);
        panel.add(btn1);
        panel.add(text1);
        panel.add(boxOrder1);
        panel.add(boxOrder2);
        panel.add(boxOrder3);
        panel.add(boxOrder4);
//        String file = Home.class.getResource("/banner/class.png").getFile();
//        jf.setIconImage(ImageIO.read(new File(file)));


        jf.setContentPane(panel);
        jf.revalidate();
    }

}
